package net.mapper;

import net.pojo.Artile;
import net.pojo.Dicuss;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author admin
 * @Date 2019/5/22 10:21
 */
public interface ArtileMapper {
    List<Artile> findAll();

    List<Artile> findByTags(@Param(value = "tags") String tags);

    List<Artile> findByComment();

    Artile findById(@Param(value = "pid") Integer pid);

    List<Artile> findByClick();

    List<Artile> search(@Param(value = "title") String title);

    int updateClick(Artile artile);

    //查找上一条数据
    Artile findByIdPrev (@Param(value = "pid") Integer pid);

    //查找下一条
    Artile findByIdNext (@Param(value = "pid") Integer pid);

    int updateComment(Artile artile);

    List<Dicuss> findAllByDpid(Integer dpid);

    //添加评论
    int insertDicuss(Dicuss dicuss);

    List<Artile> findThreeByTags(@Param(value = "tags") String tags);
}
